package csu.rjxyg.action.userAction;

import java.io.IOException;

import csu.rjxyg.action.BaseAction;
import csu.rjxyg.action.constant.UserConstant;
import csu.rjxyg.bean.core.BaseObject;
import csu.rjxyg.dao.BaseDaoAdapter;
import csu.rjxyg.factory.core.DaoFactory;
import csu.rjxyg.factory.core.UtilFactory;
import csu.rjxyg.util.LogUtil;

/**
 * URL: GetUserInfoById(.action)
 * 参数: userId
 * @author acer
 *
 */
public class GetUserInfoByIdAction extends BaseAction {
	private LogUtil log;
	
	private String userId;
	
	public GetUserInfoByIdAction(){
		this.log = UtilFactory.getLogUtil(this.getClass());
	}
	
	public void GetUserInfoById() throws IOException{
		if(userId == null || userId.equals("")){
			this.out("error:请提交userId");
		}
		BaseDaoAdapter userDAO = DaoFactory.getDaoByColName(UserConstant.COLLECTION_NAME);
		BaseObject userBean = userDAO.getBeanInfoById(userId);
		userBean.set(UserConstant.USER_PASS, "");
		this.out(userBean.getBean().toString());
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}
}
